<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>
        ${title}
    </title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=basePath%>/css/ionicons.min.css">
    <link rel="stylesheet" href="<%=basePath%>/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<%=basePath%>/toastr/toastr.css" type="text/css"/>
    <link rel="stylesheet" href="<%=basePath%>/dist/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="<%=basePath%>/fileupload/fileinput.min.css"/>
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="<%=basePath%>/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/pagination/style/pagination.css" media="screen">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/loaders/loaders.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/animate.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/bootstrap-treeview/css/bootstrap-treeview.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/viewer/viewer.min.css">
</head>
    <body class="hold-transition skin-blue sidebar-mini">
    <div id="request-div" style="position: absolute;width: 100%;height: 100%;z-index: 10;display: none;">
        <img src='../images/request-sending.gif' style="position: relative;top: 50%;left: 50%;width: 70px;height: 70px">
    </div>
    <div class="wrapper">
        <header class="main-header">
            <!-- Logo -->
            <jsp:include page="../logo.jsp" ></jsp:include >
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-fixed-top">
                <!-- Sidebar toggle button-->
                <a class="sidebar-toggle" data-toggle="offcanvas" role="button" onclick="show()">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <jsp:include page="../menuTop.jsp"></jsp:include>
            </nav>

        </header>


        <!-- Left side column. contains the sidebar -->
        <aside class="main-sidebar">
            <jsp:include page="../menu.jsp"></jsp:include>
            <!-- /.sidebar -->
        </aside>

        <input type="hidden" id="basePath" value="<%=basePath%>">
        <input type="hidden" id="userType" value="${loginUser.type}">

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper" style="padding-top:50px;">
            <section class="content-header">
                <ol class="breadcrumb">
                    <li class="text-muted"><i class="fa fa-th"></i>&nbsp;&nbsp;设备管理:
                    </li>
                    <li class="text-muted"><i class="fa fa-circle-o"></i>&nbsp;&nbsp;设备管理
                    </li>
                </ol>
            </section>

            <section class="content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="box box-info">
                            <div class="box-header with-border text-left">
	      				<span class="">
                            <c:if test="${loginUser.type != 1101}">
                                <button id="add" type="button"  class="btn btn-info btn-sm" data-toggle="tooltip" title="新增">
                                    <i class="fa fa-plus"></i>
                                </button>
                                <button id="edit" type="button"  class="btn btn-info btn-sm" data-toggle="tooltip" title="修改" >
                                    <i class="fa fa-pencil"></i>
                                </button>
                            </c:if>
                                <button id="upload" type="button"  class="btn btn-info btn-sm" data-toggle="tooltip" title="文件上传" >
                                    <i class="fa fa-upload"></i>
                                </button>
						</span>
                        <span class="pull-right">
                            <span>显示</span>
                            <select id="show-count" style="color: #EA544A">
                                <option value="20">20</option>
                                <option value="50">50</option>
                                <option value="100">100</option>
                                <option value="200">200</option>
                            </select>
                            <span>条，</span>
                            <span>共计</span>
                            <span id="total-count">0</span>
                            <span>条</span>
                            <%--<button id="execlReport" type="button" class="btn btn-info btn-sm" data-toggle="tooltip" title="导入">
                                      <i class="fa fa-file-excel-o"></i>
                            </button>--%>
                            <button id="search" type="button" class="btn btn-info btn-sm" data-toggle="tooltip" title="查询">
                                <i class="fa fa-search"></i>
                            </button>
	                  	</span>
                            </div>

                            <div class="box-body" style="margin: 5px 0px -10px 0px">
                                <!-- form start -->
                                <form id="queryForm" action="<%=basePath%>/device/page" method="post">
                                    <div class="row">
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <input type="text" class="form-control"  name="allName" value="" placeholder='设备名称/型号/序列号'>
                                            </div>
                                        </div>
                                        <c:if test="${loginUser.type != 1101}">
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <select style="width: 100%" name="hospitalId">
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <select style="width: 100%" name="manufacturerId">
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <select style="width: 100%" name="maintainerId">
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
                                                <div class="form-group">
                                                    <select name = 'supplierId' style="width: 100%"></select>
                                                </div>
                                            </div>
                                        </c:if>
                                    </div>
                                </form>
                            </div>
                            <div class="box-body table-responsive no-padding">
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr class="info">
                                            <th class="text-muted" style="width: 20px">#</th>
                                            <th class="text-center text-muted" style="width: 35px">&nbsp;</th>
                                            <th class="text-center text-muted" >操作</th>
                                            <th class="text-muted">设备名称</th>
                                            <th class="text-muted">设备型号</th>
                                            <th class="text-muted">序列号</th>
                                            <th class="text-muted">厂家</th>
                                            <th class="text-muted">经销商</th>
                                            <c:if test="${loginUser.type != '1101'}">
                                                <th class="text-muted">医院</th>
                                            </c:if>
                                            <th class="text-muted">维修商</th>
                                            <th class="text-muted">保养周期(月)</th>
                                            <th class="text-muted">购买日期</th>
                                            <th class="text-muted">安装日期</th>
                                            <th class="text-muted">设备状态</th>
                                            <th class="text-muted">负责人</th>
                                        </tr>
                                    </tbody>
                                    <tfoot id="device_table">
                                    </tfoot>
                                </table>
                            </div>
                            <!-- <div class="box-footer clearfix">
                                <div class="M-box3 text-center"></div>
                            </div> -->
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <div id="add-modal" style="display: none;">
            <div class="row">
                <div class="box-body">
                    <form class="form-horizontal" id="add-update-from" method="post" enctype="multipart/form-data">
                        <input type="hidden" value="" name="deviceId">
                        <div class="form-group col-md-4">
                            <label class="col-sm-4 control-label text-muted">设备名称<span class="text-red">*</span></label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="deviceName">
                            </div>
                        </div>
                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">设备型号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="deviceModel">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">序列号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="sn">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">医院</label>
                            <div class="col-sm-8">
                                <select name = 'hospitalId' style="width: 100%"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">厂商</label>
                            <div class="col-sm-8">
                                <select name = 'manufacturerId' style="width: 100%"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">经销商</label>
                            <div class="col-sm-8">
                                <select name = 'supplierId' style="width: 100%"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">维修商</label>
                            <div class="col-sm-8">
                                <select name = 'maintainerId' style="width: 100%"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">产地</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="placeOrigin">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">规格</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="specifications">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">附件</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="attachment">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">资产编号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="assetsNo">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">单价</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="price">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">数量</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="quantity">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">保养周期(月)</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="upkeepCycle">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">上次保养时间</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="lastUpkeepDate" id="lastUpkeepDate">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">科室</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="department">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">安装日期</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="installDate" id="installDate">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">验收日期</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="acceptanceDate" id="acceptanceDate">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">购买日期</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="purchaseDate" id="purchaseDate">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">出厂日期</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="manufactureDate" id="manufactureDate">
                            </div>
                        </div>
                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">启用日期</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="enableTime" id="enableTime">
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">负责人</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="responsiblePerson">
                            </div>
                        </div>


                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">设备状态</label>
                            <div class="col-sm-8">
                                <select name = 'deviceStatus' style="width: 100%"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">68分类一级</label>
                            <div class="col-sm-8">
                                <select name = 'deviceTypeId' style="width: 100%" onchange="showDeviceTypeSubList(this)"></select>
                            </div>
                        </div>

                        <div class="form-group col-md-4">
                            <label  class="col-sm-4 control-label text-muted">68分类二级</label>
                            <div class="col-sm-8">
                                <select name = 'deviceTypeSubId' style="width: 100%">
                                </select>
                            </div>
                        </div>

                        <div class="form-group  col-md-8">
                            <label class="col-sm-2 control-label text-muted">备注</label>
                            <div class="col-sm-8">
                                <textarea name="remark" class="form-control"></textarea>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <div class="box-footer">
             <span class="pull-right">
                <button data-iziModal-close class="btn btn-default" style="margin-right: 5px">取消</button>
                <button id="saveDevice" type="button" class="btn btn-info">保存</button>
            </span>
            </div>

        </div>

        <div id="deviceFileDiv"></div>

        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version</b> 1.0.0
            </div>
            <strong>Copyright &copy; 2019 <a href="http://almsaeedstudio.com">Topmed</a>.</strong> All rights reserved.
        </footer>
        <jsp:include page="../menuRight.jsp"></jsp:include>
    </div>
    <!-- ./wrapper -->

    <!-- ./wrapper -->
    <script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="<%=basePath%>/bootstrap/js/bootstrap.min.js"></script>
    <script src="<%=basePath%>/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script src="<%=basePath%>/plugins/fastclick/fastclick.js"></script>
    <script src="<%=basePath%>/dist/js/app.min.js"></script>
    <script src="<%=basePath%>/dist/js/demo.js"></script>
    <script src="<%=basePath%>/bootstrapvalidator/js/bootstrapValidator.min.js"></script>
    <script src="<%=basePath%>/toastr/toastr.js"></script>
    <script src="<%=basePath%>/pagination/js/jquery.pagination.min.js"></script>
    <script src="<%=basePath%>/js/overallSituation.js"></script>
    <script src="<%=basePath%>/fileupload/fileinput.min.js"></script>
    <script src="<%=basePath%>/fileupload/zh.js" type="text/javascript"></script>
    <script src="<%=basePath%>/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="<%=basePath%>/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/select2/select2.min.js"></script>
    <script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
    <script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
    <script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
    <script src="<%=basePath%>/plugins/bootstrap-treeview/js/bootstrap-treeview.js"></script>
    <script src="<%=basePath%>/plugins/viewer/viewer.min.js"></script>
    <script src="<%=basePath%>/js/device/device-page.js"></script>
    <script src="<%=basePath%>/js/file-upload.js"></script>
    </body>
</html>
